#include <iostream>
#include <pthread.h>
using namespace std;
void *fun(void *argc)
{
    printf("执行fun函数的线程号：%lu\n", pthread_self());
    return NULL;
}

void *fun2(void *argc)
{
    printf("val==%d\n", (int)(long)argc);
    return NULL;
}


int main()
{
    pthread_t tid = 0;
    pthread_t tid2 = 0;
    int ret = pthread_create(&tid, NULL, fun, NULL);
    if (ret != 0)
    {
        printf("创建错误\n");
        return 1;
    }
    printf("执行main函数的线程号：%lu\n", pthread_self());


    ret = pthread_create(&tid2, NULL, fun2, (void*)0x300);
    if (ret != 0)
    {
        printf("创建错误\n");
        return 1;
    }


    printf("按任意键继续...\n");
    getchar();
    return 0;
}